package com.sinosun.autotestmachine.tools.parser;

import android.util.Log;

public class FileDetail implements java.lang.Comparable<FileDetail>{
	private String md5;
	private String fileId;
	private FileType fileType;
	private String fileName;
	private boolean inCache;
	
	public FileDetail() {
		md5 = new String("");
		fileId = new String("");
		fileName = new String("");
		fileType = FileType.FILE;
		inCache = false;
	}
	
	public String getFileName() {
		return this.fileName;
	}
	
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	
	public void setInCache(boolean inCache) {
		this.inCache = inCache;
	}
	
	public boolean getInCache() {
		return this.inCache;
	}
	
	public void setMD5(String md5) {
		this.md5 = md5;
	}
	
	public String getMD5() {
		return this.md5;
	}
	
	public void setFileId(String fileId) {
		this.fileId = fileId;
	}
	
	public String getFileId() {
		return this.fileId;
	}
	
	public void setFileType(FileType type) {
		this.fileType = type;
	}
	
	public FileType getFileType() {
		return this.fileType;
	}
	
	@Override public int compareTo(FileDetail other) {
		return this.fileId.compareToIgnoreCase(other.fileId);
	}
	
	@Override public boolean equals(Object o){
		FileDetail other = (FileDetail)o;
		Log.e("XXX", "FileDetail compareTo()()");
		Log.e("XXX", "FileDetail compareTo " + other.getMD5());
		Log.e("XXX", "FileDetail compareTo " + other.getFileId());
		Log.e("XXX", "FileDetail compareTo " + this.getMD5());
		Log.e("XXX", "FileDetail compareTo " + this.getFileId());
		if (other.getMD5().equals(this.getMD5()) && other.getFileId().equals(this.getFileId())) {
			return true;
		}
		return false;
	}
}
